package com.zhongwang.business.gen.mapper;

import com.zhongwang.business.gen.entity.User;
import com.zhongwang.business.gen.entity.UserExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;

public interface UserMapper {
    long countByExample(UserExample example);

    int deleteByExample(UserExample example);

    int deleteByPrimaryKey(Integer id);

    int insert(User record);

    int insertSelective(User record);

    List<User> selectByExampleWithBLOBs(UserExample example);

    List<User> selectByExample(UserExample example);

    User selectByPrimaryKey(Integer id);

    int updateByExampleSelective(@Param("record") User record, @Param("example") UserExample example);

    int updateByExampleWithBLOBs(@Param("record") User record, @Param("example") UserExample example);

    int updateByExample(@Param("record") User record, @Param("example") UserExample example);

    int updateByPrimaryKeySelective(User record);

    int updateByPrimaryKeyWithBLOBs(User record);

    int updateByPrimaryKey(User record);

    User selectById(Integer id);

    int deleteUserRoleByUserId(Integer id);

    /**
     * 保存用户，角色关联关系
     *
     * @param uId     用户ID
     * @param roleIds 角色ID数组
     */
    void batchInsertUserRole(@Param("uId") Integer uId, @Param("roleIds") Integer[] roleIds);
}